package com.server.questionbank.snframe.domain.Course.Member;

import lombok.Data;

@Data
public class CoursePermission {
    private Integer permissionFlags = 0;

    public boolean hasPermission(Permission permission) {
        return (permissionFlags & permission.getValue()) != 0;
    }

    public void addPermission(Permission permission) {
        permissionFlags |= permission.getValue();
    }

    public void removePermission(Permission permission) {
        permissionFlags &= ~permission.getValue();
    }
}
